Fractale Tree  0.5
Plot Tree Fractale
Public Slots | Signals | Public Member Functions | Private Attributes | List of all members
QWidget_Ratio Class Reference

#include <qwidget_ratio.h>

Inheritance diagram for QWidget_Ratio:
Inheritance graph
[legend]
Collaboration diagram for QWidget_Ratio:
Collaboration graph
[legend]

Public Slots

void CheckBox_Update ()
 

Signals

void Value_changed ()
 

Public Member Functions

 QWidget_Ratio (QWidget *parent=0)
 
double Get_Ratio ()
 
void Set_Ratio (double ratio)
 
bool isChecked ()
 
void Set_Checked (bool etat)
 

Private Attributes

QGridLayout * layout
 
QDoubleSpinBox * DoubleSpinBox_ration
 
QLabel * Label_ration
 
QCheckBox * CheckBox
 

Detailed Description

Definition at line 19 of file qwidget_ratio.h.

Constructor & Destructor Documentation

◆ QWidget_Ratio()

QWidget_Ratio::QWidget_Ratio ( QWidget *  parent = 0)
explicit

Definition at line 3 of file qwidget_ratio.cpp.

References CheckBox, CheckBox_Update(), DoubleSpinBox_ration, Label_ration, layout, and Value_changed().

3  : QWidget(parent)
4 {
5  // Init
6  DoubleSpinBox_ration = new QDoubleSpinBox();
7  DoubleSpinBox_ration->setMinimum(0);
8  DoubleSpinBox_ration->setMaximum(200);
9  DoubleSpinBox_ration->setValue(80);
10 
11  Label_ration= new QLabel("Ratio en %");
12  Label_ration->setAlignment(Qt::AlignHCenter);
13  CheckBox = new QCheckBox("");
14  CheckBox->setChecked(true);
15  // QGridLayout_ratio
16  QGridLayout *QGridLayout_ratio = new QGridLayout;
17  QGridLayout_ratio->addWidget(Label_ration,1,1,1,2);
18  QGridLayout_ratio->addWidget(CheckBox,2,1);
19  QGridLayout_ratio->addWidget(DoubleSpinBox_ration,2,2);
20  //QGroupBox_ratio
21  QGroupBox *QGroupBox_ratio = new QGroupBox(tr("Ratio"));
22  QGroupBox_ratio->setLayout(QGridLayout_ratio);
23 
24  layout = new QGridLayout();
25  layout->addWidget(QGroupBox_ratio);
26  this->setLayout(layout);
27 
28  QObject::connect(DoubleSpinBox_ration,SIGNAL(valueChanged(double)),this,SIGNAL(Value_changed()));
29  QObject::connect(CheckBox,SIGNAL(stateChanged(int)),this,SIGNAL(Value_changed()));
30  QObject::connect(CheckBox,SIGNAL(stateChanged(int)),this,SLOT(CheckBox_Update()));
31 }
QLabel * Label_ration
Definition: qwidget_ratio.h:34
void Value_changed()
QDoubleSpinBox * DoubleSpinBox_ration
Definition: qwidget_ratio.h:33
QGridLayout * layout
Definition: qwidget_ratio.h:31
void CheckBox_Update()
QCheckBox * CheckBox
Definition: qwidget_ratio.h:36
Here is the call graph for this function:

Member Function Documentation

◆ CheckBox_Update

void QWidget_Ratio::CheckBox_Update ( )
slot

Definition at line 44 of file qwidget_ratio.cpp.

References CheckBox, and DoubleSpinBox_ration.

Referenced by QWidget_Ratio().

45 {
46  DoubleSpinBox_ration->setEnabled(CheckBox->isChecked());
47 }
QDoubleSpinBox * DoubleSpinBox_ration
Definition: qwidget_ratio.h:33
QCheckBox * CheckBox
Definition: qwidget_ratio.h:36
Here is the caller graph for this function:

◆ Get_Ratio()

double QWidget_Ratio::Get_Ratio ( )

Definition at line 39 of file qwidget_ratio.cpp.

References DoubleSpinBox_ration.

Referenced by Draw_Tree::Plot(), and Main_fenetre::Save_file().

40 {
41  return DoubleSpinBox_ration->value();
42 }
QDoubleSpinBox * DoubleSpinBox_ration
Definition: qwidget_ratio.h:33
Here is the caller graph for this function:

◆ isChecked()

bool QWidget_Ratio::isChecked ( )

Definition at line 49 of file qwidget_ratio.cpp.

References CheckBox.

Referenced by Draw_Tree::Plot(), and Main_fenetre::Save_file().

50 {
51  return CheckBox->isChecked();
52 }
QCheckBox * CheckBox
Definition: qwidget_ratio.h:36
Here is the caller graph for this function:

◆ Set_Checked()

void QWidget_Ratio::Set_Checked ( bool  etat)

Definition at line 54 of file qwidget_ratio.cpp.

References CheckBox.

Referenced by Main_fenetre::Open_file().

55 {
56  CheckBox->setChecked(etat);
57 }
QCheckBox * CheckBox
Definition: qwidget_ratio.h:36
Here is the caller graph for this function:

◆ Set_Ratio()

void QWidget_Ratio::Set_Ratio ( double  ratio)

Definition at line 34 of file qwidget_ratio.cpp.

References DoubleSpinBox_ration.

Referenced by Main_fenetre::Open_file().

35 {
36  DoubleSpinBox_ration->setValue(ratio);
37 }
QDoubleSpinBox * DoubleSpinBox_ration
Definition: qwidget_ratio.h:33
Here is the caller graph for this function:

◆ Value_changed

void QWidget_Ratio::Value_changed ( )
signal

Referenced by QWidget_Ratio().

Here is the caller graph for this function:

Member Data Documentation

◆ CheckBox

QCheckBox* QWidget_Ratio::CheckBox
private

Definition at line 36 of file qwidget_ratio.h.

Referenced by CheckBox_Update(), isChecked(), QWidget_Ratio(), and Set_Checked().

◆ DoubleSpinBox_ration

QDoubleSpinBox* QWidget_Ratio::DoubleSpinBox_ration
private

Definition at line 33 of file qwidget_ratio.h.

Referenced by CheckBox_Update(), Get_Ratio(), QWidget_Ratio(), and Set_Ratio().

◆ Label_ration

QLabel* QWidget_Ratio::Label_ration
private

Definition at line 34 of file qwidget_ratio.h.

Referenced by QWidget_Ratio().

◆ layout

QGridLayout* QWidget_Ratio::layout
private

Definition at line 31 of file qwidget_ratio.h.

Referenced by QWidget_Ratio().


The documentation for this class was generated from the following files: